
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ include file="/common/common.jsp"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="./style/oa.css" rel="stylesheet" type="text/css">
<script language="javascript" src="script/public.js"></script>
<script type="text/javascript" src="script/jquery.js"></script>
<title>选择文件
</title>

<script type="text/javascript">
		var funcNum = <%=request.getParameter("CKEditorFuncNum")%>;
		function submit(page) {
			
			var data='moduleId=${module.id}&'+ "browser=true&"+
				'orderBy='+$("#orderBy").val() + '&'+
				'desc='+($("#desc").attr("checked") ? 'true':'false') +'&'+
				'typeId='+${typeId} + "&currentPage=" + page +
				'&CKEditorFuncNum=' + funcNum;
				window.location.href = '${module.url}?' + data;
		}
		
		function funCallback(funcNum, fileUrl) {
			var parentWindow = (window.parent == window) ? window.opener
					: window.parent;
			parentWindow.CKEDITOR.tools.callFunction(funcNum, fileUrl);
			window.close();
		}
				
		function selected(id){
			funCallback( funcNum,"resource!download?id=" + id);
		}
	
</script>

</head>
<BODY bgColor=#dee7ff leftMargin=0 background="" topMargin=0
	marginheight="0" marginwidth="0">
	<center>
		<table width="800" border="0" cellPadding="0" cellSpacing="0"
			borderColor="#ffffff" bgColor="#dee7ff" style="FONT-SIZE: 10pt">
			<tbody>
				<tr height="35">
					<td align="middle" width="20" background="images/title_left.gif"
						bgColor="#dee7ff"></td>
					<td align="middle" width="120" background="images/title_left.gif"
						bgColor="#dee7ff"><font color="#f7f7f7">选择文件<font color="#FFFFFF">&nbsp;</font> </font>
					</td>
					<td align="middle" width="11" background="images/title_middle.gif"
						bgColor="#dee7ff"><font color="#f7f7f7">&nbsp;</font>
					</td>
					<td align="middle" background="images/title_right.gif"
						bgColor="#dee7ff"><font color="#f7f7f7">&nbsp;</font>
					</td>
				</tr>
				
			</tbody>
		</table>
		<table width="800" border="0" align="center" cellPadding="0"
			cellSpacing="0" borderColor="#ffffff" style="FONT-SIZE: 10pt">
			<tbody>
				
				
				<tr>
					<td colspan="1" height="14" noWrap="">
						<a	href="javascript:void(0);" onClick="submit(${currentPage});">刷新</a>
						&nbsp;&nbsp;					
					
						
							排序<select id="orderBy" onChange="submit(${currentPage});">
								<option value="createDate" ${orderBy=="createDate" ? 'selected':'' }>创建时间</option>							
								<option value="name" ${orderBy=="name" ? 'selected':'' }>文件名</option>
								<option value="size" ${orderBy=="size" ? 'selected':''}>大小</option>
                     		</select>
                     		 &nbsp;&nbsp;&nbsp;&nbsp; 
							<input id="desc" type="checkbox" value="true" onClick="submit(${currentPage});" ${desc ? 'checked':'' }>降序
									
						</td>
						</tr>
						<tr>
					<td height="28" colspan="2" align="right" vAlign="center" noWrap
						background="images/list_middle.jpg">&nbsp;&nbsp; <!-- 可以在这里插入分页导航条 -->
					</td>
				</tr>
				
			</tbody>
		</table>
		<table id="table1" width="800" border="0" cellPadding="0"
			cellSpacing="1">
			<!-- 列表数据栏 -->
				<tr  >
			<s:iterator value="pm.datas" var="p" status="st">
				
				<s:if test="#st.index % 4 == 0 && #st.index>0">
					</tr>
					<tr>
				</s:if>
			
				<td width="200px" align="center" valign="middle" nowrap>
				<table width='200px' class="TableBody1" onMouseOut="this.bgColor = '#DEE7FF';"
					onMouseOver="this.bgColor='#EFF3F7';">
                    <tr>
                    <td colspan="2" align="center" valign="bottom" nowrap>
                    <label for="cbId${p.id }">
							<input name="id" id="cbId${p.id }" type="radio" value="${p.id}" onClick="selected(this.value)"/> 
								<span type="overflow:hidden;">${p.name}</span>								
                           </label> 
                           
                  </tr>
					<tr>
						<td width="100" align="center" vAlign="top">
						
							<div align="center"
								style="width:100px; height:100px; background-color: #CCC;">
								<table width="100%" height="96" align="center">
									<tr>
										<td align="center" valign="middle"><img name="icon"
											src="resource!icon?id=${p.id}" alt="${p.name}"
											style="max-width:96px; max-height:96px"></td>
									</tr>
	
								</table>
							</div>
							</td>
					</tr>
				</table>
			</td>
           	
			</s:iterator>
		</tr>



			<!-- 在列表数据为空的时候，要显示的提示信息 
			-->
			<s:if test="pm.datas.size == 0">
				<tr valign="top">
					<td colspan="8" align="center" bgcolor="#EFF3F7" class="TableBody1"
						onMouseOver="this.bgColor = '#DEE7FF';"
						onMouseOut="this.bgColor='#EFF3F7';">没有找到相应的记录</td>
				</tr>
			</s:if>
		</table>

		<table width="800" border="0" align="center" cellPadding="0"
			cellSpacing="0" borderColor="#ffffff" style="FONT-SIZE: 10pt">
<tbody>
				<tr>
					<td height="28" align="right" vAlign="center" noWrap=""
						background="images/list_middle.jpg">&nbsp;&nbsp; <!-- 可以在这里插入分页导航条 -->


						<a href="javascript:void(0)" onclick="submit(1)">首页</a> <a
						href="javascript:void(0)" onclick="submit(${pm.prePage})">前页</a> 当前第<font
						color="red"> ${pm.currentPage} </font>页， 共 <s:property
							value="pm.pageCount" />页&nbsp;&nbsp; <s:iterator
							value="pm.pageList" var="page">
							<s:if test="pm.currentPage == #page">
								<b>${page}</b>
							</s:if>
							<s:else>
								<a href="javascript:void(0)" onclick="submit(${page})">${page }</a>
							</s:else>
						&nbsp;
						</s:iterator> 
						<a href="javascript:void(0)" onclick="submit(${pm.nextPage})">后页</a> 
						<a href="javascript:void(0)" onclick="submit(${pm.pageCount})">尾页</a>
					</td>
				</tr>
			</tbody>
		</table>
	</center>


</body>

</html>

